      Program ex1
******************************************************************************
*                                                                            *
*     This test program illustrates 1D Finite Impulse Response (FIR) and     *
*     Infinite Impulse Response (IIR) filters.                               *
*                                                                            *
*     We use here double precision versions DFIR1D and DIIR1D                *
*                                                                            *
******************************************************************************
*                                                                            *
*     We first apply the IIR filter to an Impulse input                      *
*     We use then the same filter as a FIR filter...                         *
*     The final result an Impulse signal !                                   *
*                                                                            *
******************************************************************************
      parameter (MAX=7)
      double precision impulse(0:MAX), filter(0:1)
      double precision out1(0:MAX), out2(0:MAX)
      impulse(0) = 1.0d0
      do i = 1, MAX
        impulse(i) = 0.0d0
      end do
      filter(0) = 1.0d0
      filter(1) = 0.3d0
*  IIR filter:
      call diir1d( impulse,1,0,MAX+1,filter,1,0,2,out1,1,0,MAX+1)
*  FIR filter:
      call dfir1d(out1,1,0,MAX+1,filter,1,0,2,out2,1,0,MAX+1,1.d0,0.d0)
      write(6,11)
      write(6,12) impulse(0:MAX)
      write(6,13)
      write(6,12) out1(0:MAX)
      write(6,14)
      write(6,12) out2(0:MAX)
 11   format('Input is an Impulse: ')
 12   format(8f9.5)
 13   format(/'After application of IIR filter:')
 14   format(/'After a final FIR filter, output is an Impulse again:')
      stop
      end
